<template>

	<el-table-column type="index" label="#" show-overflow-tooltip />

	<el-table-column prop="g_name" :label="$t('machine.goods.name')" show-overflow-tooltip>
		<template #default="scope">
			{{ scope.row.g_name || '--' }}
		</template>
	</el-table-column>

	<el-table-column prop="totalQuantity" :label="$t('home.salesVolume')" show-overflow-tooltip>
		<template #default="scope">
			{{ scope.row.totalQuantity || '0' }}
		</template>
	</el-table-column>

	<el-table-column prop="retail_price" :label="$t('order.goods.unitPrice')" show-overflow-tooltip>
		<template #default="scope">
			{{ getmoney(scope.row) }}
		</template>
	</el-table-column>
	<el-table-column prop="totalPrice" :label="$t('order.goods.totalPrice')" show-overflow-tooltip>
		<template #default="scope">
			{{ gettotalPrice(scope.row) }}
		</template>
	</el-table-column>

</template>
<script lang="ts" setup>
import { useI18n } from 'vue-i18n'
const { t: $t } = useI18n()

// 单价
let getmoney = (e) => {
	let money = '0.00'
	if (e.id == '') {
		return money
	}

	money = (e.retail_price * 1).toFixed(2)

	return money || '0.00'
}
// 总价
let gettotalPrice = (e) => {
	let money = '0.00'
	if (e.id == '') {
		return money
	}
	money = (e.totalPrice * 1).toFixed(2)
	return money || '0.00'
}
</script>